import request from '@/utils/request';


/**
 * 素材库查询
 * @param {*} params 
 * @returns 
 */
export const queryLibList = params => {
    return request.get('/sys/trainingOnlineMaterial/queryLib', params);
}
/**
 * 素材库新增
 * @param {*} data 
 * @returns 
 */
export const addLibInfo = data => {
    return request.post('/sys/trainingOnlineMaterial/insertLib', data);
}
/**
 * 素材库更新
 * @param {*} data 
 * @returns 
 */
export const updateLibInfo = data => {
    return request.post('/sys/trainingOnlineMaterial/updateLib', data);
}
/**
 * 素材库删除（素材库下面有素材时 ，不允许删）
 * @param {*} data 
 * @returns 
 */
export const deleteLibInfo = data => {
    return request.post(`/sys/trainingOnlineMaterial/deleteLib`, data)
}

/**
 * 素材列表查询
 */
export const remoteList = params => {
    return request.get('/sys/trainingOnlineMaterial/queryList', params);
};
/**
 * 素材新增
 */
export const addInfo = data => {
    return request.post('/sys/trainingOnlineMaterial/insertList', data);
};

/**
 * 更新
 */
export const updateInfo = data => {
    return request.post('/sys/trainingOnlineMaterial/updateList', data);
};

/**
 * 删除
 */
export const deleteInfo = data => {
    return request.post(`/sys/trainingOnlineMaterial/deleteList`, data)
}

/**
 * 下载资源内容
 */
export const downloadPackage = data => {
    return request.post(`/sys/trainingOnlineMaterial/download`, data, 'blob')
}
export default {
    remoteList
}